package day01.map集合;


import java.util.TreeMap;

/**
 * @author feng
 * @Date 2021/10/17 21:03
 *  TreeMap在实现时，必须进行比较，在存放数据时，key值无法比较抛出异常
 */
public class TreeMapTest {

    public static void main(String[] args) {

        TreeMap<Students,Integer> treeMap = new TreeMap();
        treeMap.put(new Students("bli",12,160.0),1001);
        treeMap.put(new Students("ali",12,156.0),1002);
        treeMap.put(new Students("cli",50,160.0),1003);
        treeMap.put(new Students("ali",15,170.0),1004);
        System.out.println(treeMap);
        System.out.println(treeMap.size());



    }

}
